﻿using com.ytocargo.Core.FlightCfps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;

namespace com.ytocargo.Application.FlightCfps
{
    public class FlightCfpServices : IFlightCfpServices, ITransient
    {

        private readonly IFlightCfpStore _flightCfpStore;
        public FlightCfpServices(IFlightCfpStore flightCfpStore)
        {
            _flightCfpStore = flightCfpStore;
        }

        public Task<List<FlightCfp>> GetUnSengdListAsync(int maxCount)
        {
            return _flightCfpStore.GetUnSengdListAsync(x => x.CfpContent != null && x.SendFlag == false, maxCount);
        }

        public Task<FlightCfp> UpdateEntityAsync(FlightCfp flightCfp)
        {
            return _flightCfpStore.UpdateEntityAsync(flightCfp);
        }
    }
}
